<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ADD Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">ADD Instruction<BR></h1>
<hr noshade></h1>
          <BR>
<span class="text">Adds two binary operands and stores the result in the destination operand.<BR>
          <BR>
  Two different methods are allowed:<BR>
          <BR>
  1. Add an effective address to a data register.<BR>
2. Add a data register to an effective address.</span></P>
  <br>
  <br>
  <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
  <TBODY>
    <TR>
      <TD width="24%" class="text">ADDRESS METHODS:</TD>
      <TD width="76%" class="text">1) Dn, An, (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l, x(PC), x(PC,xr.s), #x</TD>
    </TR>
  </TBODY>
</TABLE>
<P class="text">ADDRESS METHODS: 2) (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l<BR>
          <BR>
  DATA LENGTH: Byte, word, longword<BR>
  <BR>
  When using an address register as destination, byte is not allowed.</P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="61%">
  <TBODY>
    <TR>
      <TD width="18%" rowSpan=5 vAlign=top class="text">FLAGS:</TD>
      <TD width="82%" class="text">X - Set if carry from the most significant bit, else cleared.</TD>
    </TR>
    <TR>
      <TD width="82%" class="text">N - S</TD>
    </TR>
    <TR>
      <TD width="82%" class="text">Z - S</TD>
    </TR>
    <TR>
      <TD width="82%" class="text">C - Same as X</TD>
    </TR>
    <TR>
      <TD width="82%"><span class="text">V - S </span>
          <P>&nbsp;</P></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="57%">
  <TBODY>
    <TR>
      <TD width="20%" rowSpan=2 class="text">SYNTAX:</TD>
      <TD width="80%" class="text">ADD Dn,&lt;ea&gt;</TD>
    </TR>
    <TR>
      <TD width="80%" class="text">ADD &lt;ea&gt;,Dn</TD>
    </TR>
  </TBODY>
</TABLE>
<p><span class="text">EXAMPLE CODE:&nbsp;&nbsp;&nbsp; </span></p>
<P class="sourcecode"><span class="text">&nbsp;&nbsp; ADD.B&nbsp;&nbsp;&nbsp;&nbsp; D0,D1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adds the lower 8 bits of D0 to D1, does not change the upper 24 bits of D0 or 
D1<br>
&nbsp;&nbsp; ADD.W&nbsp;&nbsp;&nbsp; D0,D1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adds the lower 16 bits of D0 to D1, does not change the upper 16 bits of D0 or 
D1<br>
&nbsp;&nbsp; ADD.L&nbsp;&nbsp;&nbsp;&nbsp; D0,D1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; adds all 32 bits of D0 to D1</span></P>
<p>&nbsp;</p>
</body>
</html>